package com.arpa.wms.domain.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: Allen chen
 * @Date 2020/8/17
 * @Description:
 */
public enum DeliveryDistributionStatusEnum {
    /**
     * 分配状态
     */
    DISTRIBUTED(0,"已分配"),
    CANCEL(1,"已取消"),
    VOID(101,"已作废");

    DeliveryDistributionStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private  static final Map<Integer, DeliveryDistributionStatusEnum> STATUS_MAP = new HashMap<>();

    static {
        DeliveryDistributionStatusEnum[] values = values();
        int length = values.length;
        for (int i=0;i<length;i++){
            DeliveryDistributionStatusEnum value = values[i];
            STATUS_MAP.put(value.getCode(),value);
        }
    }

    public static DeliveryDistributionStatusEnum getEnumByCode(Integer code){
        return STATUS_MAP.get(code);
    }

    private final Integer code;

    private final String desc;

    public Integer getCode() {
        return code;
    }


    public String getDesc() {
        return desc;
    }

}
